function [ factors ] = getFactors( tiles, pos)
%GETFACTORS Summary of this function goes here
%   Detailed explanation goes here

    t = length(tiles.origin_x);

    num_pos_per_tile = tiles.num_x*tiles.num_y;
    factors = zeros(1,num_pos_per_tile*t);
    
    for i=1:t
        x = pos(1);
        y = pos(2);

        mov_x = floor((x-tiles.origin_x(i))*tiles.x_side)+2;
        mov_y = floor((y-tiles.origin_y(i))*tiles.y_side)+2;
        
        
        p = mov_x + mov_y*tiles.num_x;
        %display(['(' num2str(mov_x) ',' num2str(mov_y) ')']);
        factors((i-1)*num_pos_per_tile + p) = 1;
    end

end

